class_name SmallOperation extends Node

var operationManager = null
var small:Small

func init(om:OperationManager):
	self.operationManager = om
	return self

# 准备阶段，让周围point开启监听
func preparation():
	operationManager.arr_listeningPoints.clear()
	var point = operationManager.selectedPoint
	var arrAroundPoints = GameUtils.getArrPointsAround(point)
	for p in arrAroundPoints:
		if p.is_view:
			if [Terrain.shan,Terrain.shui,Terrain.jing].has(p.real_terrain):
				continue
			if p.small != null:
				continue
			if p.big != null:
				if p.big.player.is_me:
					continue
				if !p.big.arr_states.has(BigStateType.HIDE):	#敌人大子没有潜行
					continue
		operationManager.arr_listeningPoints.append(p)
	GameUtils.neatAnimation()
	self.small = point.small
	small.detailHide()

func smallBornBig(point:Point):
	WebSocketManager.sendObj(true,"smallBornBig",{"start":small.point.id,"end":point.id})
	operationManager.cancel()
